package com.gupao.javavip.dubbo.provider;

import com.gupao.javavip.dubbo.api.IUserService;
import com.gupao.javavip.dubbo.api.dto.AddUserRequest;
import lombok.extern.apachecommons.CommonsLog;
import org.apache.dubbo.config.annotation.Service;

@CommonsLog
@Service(loadbalance = "random", timeout = 10000, cluster = "failsafe")
public class UserServiceServer implements IUserService {
    @Override
    public Long addUser(AddUserRequest request) {
        if (log.isDebugEnabled()) {
            log.debug("收到RPC调用:" + request.toString());
        }
        return 1L;
    }

    @Override
    public void sayHello() {
        if (log.isDebugEnabled()) {
            log.debug("收到RPC调用");
        }
    }
}
